Page({
  data: {
    addressItems: [
      {
        address_id: 1,
        address_name: "常用",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: '二教'
            },
            {
              child_id: 2,
              name: '图书馆'
            },
            {
              child_id: 3,
              name: '操场'
            },
            {
              child_id: 4,
              name: '共享单车'
            }
          ]
      },
      {
        address_id: 2,
        address_name: "教学楼",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: 'eryt',
              image: "../../images/test/5.png"
            },
            {
              child_id: 2,
              name: '3dwag',
              image: "../../images/test/4.png"
            },
            {
              child_id: 3,
              name: 'hrtht',
              image: "../../images/test/5.png"
            },
            {
              child_id: 4,
              name: 'ydtjy',
              image: "../../images/test/4.png"
            },
            {
              child_id: 5,
              name: 'yjtdyt',
              image: "../../images/test/4.png"
            },
            {
              child_id: 6,
              name: 'aerf',
              image: "../../images/test/4.png"
            },
            {
              child_id: 7,
              name: 'gerg',
              image: "../../images/test/4.png"
            },
            {
              child_id: 8,
              name: 'jytj',
              image: "../../images/test/4.png"
            }
          ]
      },
      {
        address_id: 3,
        address_name: "图书馆",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: 'jtytyj',
              image: "../../images/test/4.png"
            },
            {
              child_id: 2,
              name: 'tyjfyj',
              image: "../../images/test/4.png"
            },
            {
              child_id: 3,
              name: 'tuyfuk',
              image: "../../images/test/3.png"
            },
            {
              child_id: 4,
              name: 'seyu5trd',
              image: "../../images/test/1.png"
            }
          ]
      },
      {
        address_id: 4,
        address_name: "室外",
        ishaveChild: false,
        children: []
      },
      {
        address_id: 5,
        address_name: "寝室",
        ishaveChild: false,
        children: []
      },
      {
        address_id: 6,
        address_name: "隐藏地点",
        ishaveChild: false,
        children: []
      }
    ],

    cateItems: [
      {
        cate_id: 1,
        cate_name: "常用",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: '校园卡'
            },
            {
              child_id: 2,
              name: '耳机'
            },
            {
              child_id: 3,
              name: '书本'
            },
            {
              child_id: 4,
              name: '水杯'
            }
          ],
          curNav_2: 1,
          curIndex_2: 0
      },
      {
        cate_id: 2,
        cate_name: "卡片证件",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: 'eryt',
              image: "../../images/test/5.png"
            },
            {
              child_id: 2,
              name: '3dwag',
              image: "../../images/test/4.png"
            },
            {
              child_id: 3,
              name: 'hrtht',
              image: "../../images/test/5.png"
            },
            {
              child_id: 4,
              name: 'ydtjy',
              image: "../../images/test/4.png"
            },
            {
              child_id: 5,
              name: 'yjtdyt',
              image: "../../images/test/4.png"
            },
            {
              child_id: 6,
              name: 'aerf',
              image: "../../images/test/4.png"
            },
            {
              child_id: 7,
              name: 'gerg',
              image: "../../images/test/4.png"
            },
            {
              child_id: 8,
              name: 'jytj',
              image: "../../images/test/4.png"
            }
          ]
      },
      {
        cate_id: 3,
        cate_name: "电子产品",
        ishaveChild: true,
        children:
          [
            {
              child_id: 1,
              name: 'jtytyj',
              image: "../../images/test/4.png"
            },
            {
              child_id: 2,
              name: 'tyjfyj',
              image: "../../images/test/4.png"
            },
            {
              child_id: 3,
              name: 'tuyfuk',
              image: "../../images/test/3.png"
            },
            {
              child_id: 4,
              name: 'seyu5trd',
              image: "../../images/test/1.png"
            }
          ]
      },
      {
        cate_id: 4,
        cate_name: "书籍文具",
        ishaveChild: false,
        children: []
      },
      {
        cate_id: 5,
        cate_name: "生活用品",
        ishaveChild: false,
        children: []
      },
      {
        cate_id: 6,
        cate_name: "稀有掉落",
        ishaveChild: false,
        children: []
      }
    ],
    curNav_1: 1,
    curIndex_1: 0
  },

  //事件处理函数  
  switchRightTab_1: function (e) {
    console.log(e)
    // 获取item项的id，和数组的下标值  
    let id = e.target.dataset.id,
    index = parseInt(e.target.dataset.index);
    // 把点击到的某一项，设为当前index  
    this.setData({
      curNav_1: id,
      curIndex_1: index
    })
  },

switchRightTab_2: function (e) {
  console.log(e)
  // 获取item项的id，和数组的下标值  
  let id = e.target.dataset.id,
  index = parseInt(e.target.dataset.index);
  // 把点击到的某一项，设为当前index  
  this.setData({
    curNav_2: id,
    curIndex_2: index
  })
}
})

